<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <meta charset="UTF-8">
    <title>物流信息</title>
</head>
<body>
<a th:href="@{/toAddLog}">添加物流信息</a>
<table width="1000px" border="1px">
    <tr>
        <th>物流编号</th>
        <th>物流货物</th>
        <th>开始时间</th>
        <th>结束时间</th>
        <th>开始地址</th>
        <th>收货地址</th>
        <th>数量</th>
        <th>操作</th>
    </tr>
<!--    th:href="@{/findById(id=${emp.empId})}"-->
        <tr th:each="l : ${logistics}">
            <td th:text="${l.id}"></td>
            <td th:text="${l.good.goodName}"></td>
            <td th:text="${l.startTime}"></td>
            <td th:text="${l.endTime}"></td>
            <td th:text="${l.startAddress.addressShen}+${l.startAddress.addressShi}+${l.startAddress.addressQu}"></td>
            <td th:text="${l.endAddress.addressShen}+${l.endAddress.addressShi}+${l.endAddress.addressQu}"></td>
            <td th:text="${l.amount}"></td>
            <td>
                <a th:href="@{/findLogById(id=${l.id})}">更新</a>
<!--                <a href="javascript:if(confirm('是否确认删除？'))location.href='/removeLog?id=${l.id}'">删除</a>-->
                <a th:href="@{/removeLog(id=${l.id})}">删除</a>
            </td>
        </tr>

</table>


<nav aria-label="Page navigation">
    <ul class="pagination">

<!--            <c:when test="${page.current>1}">-->
                <li th:if="${page.current} > 1">
                    <a th:href="@{/getAll(current=${page.current}-1)}" aria-label="Previous">
                        <span aria-hidden="true" >&laquo;</span>
                    </a>
                </li>
<!--            </c:when>-->
<!--            <c:otherwise>-->
                <li class="disabled" th:if="${page.current} <= 1">
                    <a aria-label="Previous">
                        <span aria-hidden="true" >&laquo;</span>
                    </a>
                </li>
<!--            </c:otherwise>-->


<!--        <c:forEach var="i" begin="1" end="${page.pages}" step="1">-->

            <li th:each="i : ${#numbers.sequence(1,page.pages)}"  th:class="${page.current==i?'active':''}"><a th:href="@{/getAll(current=${i})}" th:text="${i}"></a></li>
<!--        </c:forEach>-->


<!--            <c:when test="${page.current<page.pages}">-->
                <li th:if="${page.current} < ${page.pages}">
                    <a th:href="@{/getAll(current=${page.current}+1)}" aria-label="Next">
                        <span aria-hidden="true" >&raquo;</span>
                    </a>
                </li>
<!--            </c:when>-->
<!--            <c:otherwise>-->
                <li class="disabled" th:if="${page.current} >= ${page.pages}">
                    <a  aria-label="Next">
                        <span aria-hidden="true" >&raquo;</span>
                    </a>
                </li>
<!--            </c:otherwise>-->


    </ul>
</nav>

<script src="./layui/layui.js"></script>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.cn/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</body>